public class QuickSort {

    public static void myQuickSort(int[] array,int stat,int end) {
        if (stat >= end) {
            return;
        }
        int findIndex = quick(array,stat,end);
        quick(array,stat,findIndex-1);
        quick(array,findIndex+1,end);
    }
    private static int quick(int[] array,int left,int right) {
        int index = array[left];
        while (left < right) {
            while (left < right && array[right] >= index ) {
                right--;
            }
            array[left] = array[right];
            while (left < right && array[left] <= index) {
                left++;
            }
            array[right] = array[left];
        }
        array[left] = index;
        return left;
    }
}
